package com.fss.home.mapper;

import com.fss.home.domain.*;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface HomeMapper {
    List<Home> getSwiperImages();
    List<Home> getGoodList();
    List<com.fss.home.domain.Product> selectProductWithImages();

    List<Product> selectProductByName(@Param("productName") String productName);
    List<Category2>getAllCategories();
    List<com.fss.home.domain.Product> selectCateToProduct(

            @Param("cateGoryId") long cateGoryId,
            @Param("priceMin") Double priceMin,
            @Param("priceMax") Double priceMax,
            @Param("sortType") int sortType
    );
    com.fss.home.domain.Product selectProductDetail(@Param("productId") Long productId);

    List<ProductSku> selectProductSkuByProductId(Long productId);
     List<Delivery> getDeliveryInfoByUserId(@Param("userId") Long userId);
      // 新增配送信息
    int addDeliveryInfo(Delivery delivery);

    // 修改配送信息
    int updateDeliveryInfo(Delivery delivery);
    // 删除配送信息
    int deleteDeliveryInfo(Long deliveryId);
    // 插入商品
    int insertProduct(Product product);

    void deleteProduct(Long productId);
    // 修改商品主信息
    void updateProduct(Product product);

    // 删除商品图片
    void deleteProductImages(Long productId);

    // 插入商品图片
    void insertProductImage(ProductImage productImage);

    // 删除商品 SKU
    void deleteProductSkus(Long productId);

    // 插入商品 SKU
    void insertProductSku(ProductSku productSku);
    void deleteImagesById(Long imageId);
}
